package com.riant.myspring.riant.service;

import com.riant.myspring.spring.*;

/**
 * @Classname UserService
 * @Description TODO
 * @Date 2021/5/7 23:52
 * @Created by 张斌
 */

@Component("userService")
@Scope("singleton")
//@Scope("prototype")
public class UserServiceImpl implements UserService,BeanNameAware, InitializingBean {

    @Autowired(required =true)
    private OrderService orderService;

    private String beanName;

    private String name;

    public OrderService getOrderService() {
        return orderService;
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName=beanName;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("初始化bean");
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void test() {
        System.out.println("test");
    }
}
